home *** CD-ROM | disk | FTP | other *** search
- Customizing the Services Menu Processor
- ---------------------------------------
-
- The services menu bundle has no built-in knowledge of News or Alexandra.
- It is easy to modify it to invoke other external applications. Two things
- are necessary for OmniWeb to invoke an external application for a
- particular URL:
-
- 1. The ServicesMenuProcessor must be registered as being able to
- interpret that kind of URL.
-
- 2. There must be a default indicating the Services Menu item to
- invoke.
-
- Part 1 is handled by the "converts" list in the Omni.dictionary. The processor
- should specify an "input" type of "url/scheme", where scheme is the
- relevant URL scheme, and an "output" type of "omni/source".
-
- Part 2 is handled by the "defaultsDictionary". For a given "scheme", the
- processor will look for a default named ServiceForScheme. The default
- value indicates a Services menu item to invoke.
-
- The pasteboard passed to the service contains the URL as an ASCII string.
-
- For example, the following Omni.dictionary will cause OmniWeb to invoke
- Yftp to process FTP URLs, instead of handling them internally (assuming you
- have Yftp installed, etc.):
-
- {
- OmniProcessor = {
- OmniServicesMenuProcessor = {
- converts = ({
- input = "url/news";
- output = "omni/source";
- }, {
- input = "url/ftp";
- output = "omni/source";
- cost = 0.5;
- });
- };
- };
-
- OmniPreferenceController = {
- OmniServicesMenuPreferences = {
- defaultsDictionary = {
- ServiceForNews = "Alexandra/Open URL";
- ServiceForFtp = "Yftp/Get";
- };
- };
- };
- }
-
- Notes:
- - The data returned from the service, if any, is discarded.
- - Even if a default value is specified in the defaults database,
- it must be mentioned in the bundle's defaultsDictionary for OmniWeb's
- defaults machinery to read it.
- - The services specified in the defaultsDictionary can be overridden on
- a per-user basis by NEXTSTEP defaults, e.g.
- dwrite OmniWeb ServiceForNews "SpiffyNews/Open"